package org.shj.pattern.mediator

abstract class Country(val mediator: Mediator, val name: String) {
  def declare(msg: String)
  
  def getMessage(msg: String){
    println(s"$name got message: $msg" )
  }
}

class Iraq(override val mediator: Mediator, override val name: String) extends Country(mediator, name){
  def declare(msg: String){
    mediator.sendMessage(msg, "USA")
  }
  
}

class USA(override val mediator: Mediator, override val name: String) extends Country(mediator, name){
  def declare(msg: String){
    mediator.sendMessage(msg, "Iraq")
  }
  
}